/**
Copyright (c) 2008 Arnaud Fabre <arnaud333@gmail.com>
Copyright (c) 2008 Pierre "delroth" Bourdon <root@delroth.is-a-geek.org>

This file is part of Vos Tutos Offline.

Vos Tutos Offline is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Vos Tutos Offline is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Vos Tutos Offline.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _VTO_NFORM_H
#define _VTO_NFORM_H

#include <QLineEdit>
#include <QTextEdit>
#include <QComboBox>
#include <QSpinBox>

#include "doc_part.h"
#include "treeview.h"

class NFormEditor : public QTextEdit
{
    Q_OBJECT
public:
	NFormEditor(QWidget* parent = NULL);
protected:
    virtual void insertFromMimeData(const QMimeData* source);
};

class NForm : public QWidget
{
    Q_OBJECT

friend class VTOMainWindow;

public:
    NForm(QWidget* parent);

    const QString& getText();
    NFormEditor* getEdNcode();

    Part* getEditingPart();
    void setEditingPart(Part* p);
    void hideTitledOptions();
    void displayTitleOptions();
    void clear();

signals:
    void documentChanged();
	
protected:
    void createWidgets();
    void doSlotsSignals();

public slots:
    void onTextChanged();
    void doPreview();
    
protected:
    QLineEdit *title_te;
    QComboBox *licence;
    QSpinBox *progress;
    QComboBox *difficult;
    NFormEditor *ed_ncode;
    QTextEdit *ed_preview;
    Part* p;

};

#endif

